package com.inspectortime.domain;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.management.InvalidAttributeValueException;

import com.inspectortime.common.Identifiable;
import com.inspectortime.domain.pricing.PriceAdjusterException;
import com.inspectortime.domain.type.InspectionStatus;
import com.inspectortime.domain.type.LockboxType;
import com.inspectortime.domain.type.PaymentStatus;
import com.inspectortime.domain.type.PresentAtInspectionType;

/**
 * @author Owner
 * @version 1.0
 * @created 27-Nov-2007 7:40:34 AM
 */
public interface Inspection extends Identifiable {

	public static float DEFAULT_INSPECTION_FEE = 400;

	public void generateInspectionCode() throws InvalidAttributeValueException;
	
	public String getComments();
	
	/**
	 * If an inspector/scheduled has manually entered a fee to replace the 
	 * calculated one, it will be returned
	 * 
	 */
	double getEnteredInspectionFee(); 

	HomeBuyer getHomeBuyer();
	
	HomeBuyer getSecondHomeBuyer();
		
	void setHomeBuyer(HomeBuyer homeBuyer);
	
	void setSecondHomeBuyer(HomeBuyer homeBuyer);

	public String getInspectionCode();
	
	/**
	 * The fee calculated by the pricing rules and quoted to the user
	 */
	public double getInspectionFee();

	public InspectionStatus getInspectionStatus();

	public Date getInspectionTime();

	Inspector getInspector();

	String getLockboxRealtorCode();

	LockboxType getLockboxType();

	List<String> getOptionalServiceIds();

	List<OptionalService> getOptionalServices();

	PresentAtInspectionType getPresentAtInspection();
	Property getProperty();

	RealEstateAgent getReferringAgent();

	String getRequestUrl();
	
	/** 
	 * Convenience method to return the "final" fee
	 * ie if there's an entered fee, it will be returned
	 * if not, the calculated fee will be returned
	 */
	public double getFinalInspectionFee();

	boolean isElectricityExpectedToBeOn();

	boolean isGasExpectedToBeOn();

	boolean isWaterExpectedToBeOn();
	
	String getListingAgentName();
	
	String getListingAgentPhoneNumber();
	
	/**
	 * Indicator to determine how the inspection was booked. 
	 * If true, the inspection was booked from a customer via the wizard
	 * 
	 * @return
	 */
	boolean isWebBooked();

	Serializable save();

	public void setComments(String comments);

	void setElectricityExpectedToBeOn(boolean on);

	void setEnteredInspectionFee(double enteredInspectionFee);

	void setGasExpectedToBeOn(boolean on);

	public void setInspectionCode(String inspectionCode);

	public void setInspectionFee(double inspectionFee);

	public void setInspectionStatus(InspectionStatus inspectionStatus);

	public void setInspectionTime(Date inspectionTime);

	void setInspector(Inspector inspector);

	void setLockboxRealtorCode(String lockboxRealtorCode);

	void setLockboxType(LockboxType lockboxType);

	void setPresentAtInspection(PresentAtInspectionType present);
	
	void setProperty(Property property);
	
	void setReferringAgent(RealEstateAgent agent);
	
	void setRequestUrl(String url);
	
	void setWaterExpectedToBeOn(boolean on);
	
	void setListingAgentName(String listingAgentName);
	
	void setListingAgentPhoneNumber(String listingAgentPhoneNumber);
	
	void setWebBooked(boolean isWebBooked);
	
	PaymentStatus getPaymentStatus();
	
	void setPaymentStatus(PaymentStatus paymentStatus);
}